import request from '@/utils/request'
import ruyi from '@/utils/ruoyi'

// 领用单位分发情况报表
export function receiveUnitReport(query) {
  if((query)&&(query.beginTime)&&(query.endTime)){
    return request({
      url: '/result/report/receiveunit',
      method: 'get',
      params: query
    })
  }
}

// 所属行业丰分发情况报表
export function industryReport(query) {
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/industry',
      method: 'get',
      params: query
    })
  }
}

// 典型应用分发情况报表
export function typeAppReport(query) {
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/typeapp',
      method: 'get',
      params: query
    })
  }
}

// 行政区域分发情况列表
export function adminAreaReport(query) {
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/adminarea',
      method: 'get',
      params: query
    })
  }
}

// 重点项目分发情况列表
export function majorProjectReport(query) {
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/mproject',
      method: 'get',
      params: query
    })
  }
}

// 重点项目分发情况列表
export function hotProjectReport(query) {
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/hproject',
      method: 'get',
      params: query
    })
  }
}

// 部门月报统计情况列表
export function deptMonthReport(query) {
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/deptmonth',
      method: 'get',
      params: query
    })
  }
}

export function getLastDayOfMonth(year_month){
    var year = year_month.substr(0, 4);
    var month = year_month.substr(5, 2);
    var lastDate = year_month + "-" + new Date(year, month, 0).getDate();
    return lastDate;
}

export function get4DReport(query){
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/d4',
      method: 'get',
      params: query
    })
  }
}

export function getDXTReport(query){
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/dxt',
      method: 'get',
      params: query
    })
  }
}

export function getPointReport(query){
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/point',
      method: 'get',
      params: query
    })
  }
}


export function getDLGQReport(query){
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/dlgq',
      method: 'get',
      params: query
    })
  }
}


export function getHSCGReport(query){
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/hscg',
      method: 'get',
      params: query
    })
  }
}


export function getWXYXReport(query){
  if((query)&&(query.beginTime)&&(query.endTime)) {
    return request({
      url: '/result/report/wxyx',
      method: 'get',
      params: query
    })
  }
}


export function getTestReport(query){
    return request({
      url: '/result/report/testreport',
      method: 'get',
      params: query
    })
}

export function listMateriTotal(query){
  
}


export function getMonthReportConfig(query){
  return request({
    url: '/result/report/monthconfig',
    method: 'get',
    params: query
  })
}


export function getMonthCompareReport(query){
  return request({
    url: '/result/report/monthcompare',
    method: 'get',
    params: query
  })
}


export function getTotalReportMainList(query){
  return request({
    url: '/result/materi/getTotalReportMainList',
    method: 'get',
    params: query
  })
}


export function getTotalReportDetailList(query){
  return request({
    url: '/result/orderitems/getTotalReportDetailList',
    method: 'get',
    params: query
  })
}




